package com.atguigu.chaptar3

object $01_ClassDefine {
  class Person{
     var name:String = _
    var age:Int = _
    val address="shenzhen"
     def setName(name:String)=this.name = name
     def getName()=this.name
    def printHello()=println("hello")
  }

  def main(args: Array[String]): Unit = {
    val person = new Person
    person.setName("wzx")
    println(person.getName())
    person.name="lisi"//默认的set方法
    println(person.name) //默认的get方法

  }

}
